<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta name="generator" content="HTML Tidy for Linux/x86 (vers 1st November 2003), see www.w3.org"/>
    <title>JavaScript: Basics</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="copyright" content="Copyright &#169; 2005-2010 W3C (MIT, ERCIM, Keio)"/>
    <meta name="duration" content="5"/>
    <meta name="font-size-adjustment" content="-2"/>

    <link rel="stylesheet" href="styles/slidy.css" type="text/css"/>
    <link rel="stylesheet" href="styles/w3c-blue.css" type="text/css"/>
	<script type="text/javascript" src="scripts/slidy.js" charset="utf-8">//</script>

    <link type="text/css" rel="stylesheet" href="styles/shCoreDefault.css"/>
    <script type="text/javascript" src="scripts/shCore.js"></script>
    <script type="text/javascript" src="scripts/shBrushJScript.js"></script>

    <link type="text/css" rel="stylesheet" href="styles/presentation.css"/>
    <script type="text/javascript" src="scripts/presentation.js"></script>
</head>


<body>
<div class="background">
    <img alt="" id="head-icon" src="graphics/icon-blue.png"/>
</div>

<div class="background slanty">
</div>

<div class="slide cover title">
    <img class="hidden" src="graphics/bullet.png" alt=""/>
    <img class="hidden" src="graphics/fold.gif" alt=""/>
    <img class="hidden" src="graphics/unfold.gif" alt=""/>
    <img class="hidden" src="graphics/fold-dim.gif" alt=""/>
    <img class="hidden" src="graphics/nofold-dim.gif" alt=""/>
    <img class="hidden" src="graphics/unfold-dim.gif" alt=""/>
    <img class="hidden" src="graphics/bullet-fold.gif" alt=""/>
    <img class="hidden" src="graphics/bullet-unfold.gif" alt=""/>
    <img class="hidden" src="graphics/bullet-fold-dim.gif" alt=""/>
    <img class="hidden" src="graphics/bullet-nofold-dim.gif" alt=""/>
    <img class="hidden" src="graphics/bullet-unfold-dim.gif" alt=""/>

    <h1>JavaScript: Basics Test</h1>

    <p>Alex Kolonitsky</p>
</div>

<div class="slide">
    <h1>01</h1>

    <pre class="brush: js">
        (function () {
            return typeof arguments;
        })()
    </pre>
    <ul class="incremental">
        <li>object</li>
        <li>array</li>
        <li>arguments</li>
        <li>undefined</li>
    </ul>
</div>

<div class="slide">
    <h1>02</h1>

    <pre class="brush: js">
        var f = function g() {return 42;}
        typeof g();
    </pre>

    <ul class="incremental">
        <li>number</li>
        <li>undefined</li>
        <li>function</li>
        <li>Error</li>
    </ul>
</div>

<div class="slide">
    <h1>03</h1>

    <pre class="brush: js">
        var y = 1, x = y = typeof x;
        x;
    </pre>

    <ul class="incremental">
        <li>1</li>
        <li>"number"</li>
        <li>undefined</li>
        <li>"undefined"</li>
    </ul>
</div>

<div class="slide">
    <h1>04</h1>

    <pre class="brush: js">
        (function f(f) {
            return typeof f();
        })(function () { return 1; })
    </pre>

    <ul class="incremental">
        <li>"number"</li>
        <li>"undefined"</li>
        <li>"function"</li>
        <li>Error</li>
    </ul>
</div>


<div class="slide">
    <h1>05</h1>

    <pre class="brush: js">
        var foo = {
            bar: function () {return this.baz;},
            baz: 1
        };
        (function () {
            return typeof arguments[0]();
        })(foo.bar)
    </pre>

    <ul class="incremental">
        <li>"undefined"</li>
        <li>"object"</li>
        <li>"number"</li>
        <li>"function"</li>
        <li>Error</li>
    </ul>
</div>

<div class="slide">
    <h1>06</h1>

    <pre class="brush: js">
        var f = (function f() { return "1"; },
                 function g() {return 2;})();
        typeof f;
    </pre>

    <ul class="incremental">
        <li>"string"</li>
        <li>"number"</li>
        <li>"function"</li>
        <li>"undefined"</li>
    </ul>
</div>

<div class="slide">
    <h1>07</h1>

    <pre class="brush: js">
        with (function (x, undefined) {}) length;
    </pre>

    <ul class="incremental">
        <li>1</li>
        <li>2</li>
        <li>undefined</li>
        <li>Error</li>
    </ul>
</div>

<div class="slide">
    <h1>08</h1>

    <p>Какое из этих ключевых слов ООП не используется в javascript (1.5) </p>

    <ul>
        <li>this</li>
        <li>instanceOf</li>
        <li>super</li>
        <li>new</li>
        <li>Все есть</li>
    </ul>
</div>

<div class="slide">
    <h1>09</h1>

    <p>Есть ли разница между выражениями?</p>
    <pre class="brush: js">
        !!(a && b)
        (a && b)
    </pre>

    <ul>
        <li>Да</li>
        <li>Нет</li>
        <li>В первом выражении ошибка, что еще за "!!" ??</li>
    </ul>
</div>

<div class="slide">
    <h1>10</h1>

    <p>Какова длина a.length массива a ?</p>
    <pre class="brush: js">
        var a = []
        a[1] = 5
        a[5] = 55
    </pre>

    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
        <li>6</li>
        <li>Другое</li>
    </ul>
</div>

<div class="slide">
    <h1>11</h1>

    <p>Чему равно i в конце кода ?</p>
    <pre class="brush: js">
        var i = 5
        {
           var i = 1
        }
    </pre>

    <ul>
        <li>1</li>
        <li>5</li>
        <li>undefined</li>
        <li>Error</li>
    </ul>
</div>

</body>

</html>
